﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace TVC_WEB.Global.UserControl
{
    public partial class NewsCategory : System.Web.UI.UserControl
    {
        public String Listnewscate = "";
        string sErr = "";

        protected void Page_Load(object sender, EventArgs e)
        {
            Listnewscate = LoadListNewsCate();
        }

        protected String LoadListNewsCate()
        {
            String kq = "";
            BUS.NewsCategoriesControl ctr = new BUS.NewsCategoriesControl();
            DataTable dt = ctr.GetAll(ref sErr);

            foreach (DataRow row in dt.Rows)
            {
                kq += "<div style=\"padding:5px 0 5px 0\"><b>&nbsp;•&nbsp;&nbsp;</b>";
                kq += "<a class=\"sub\" href=\"NewsList.aspx?IDNewsCategory=" + row["ID"].ToString() + "\">" + row["NameVN"].ToString() + "</a>";
                kq += "</div>";
            }


            return kq;
        }
    }
}